<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<script type="text/javascript">
	function setMemberPosition(row) {
		//获取人员的角色
		$.get("app/user/getUserRoles", {
			username : row[0]
		}, function(data) {

			var roles = "";
			$(data).each(function(index, item) {
				roles += "<option value='"+item.id+"'>" + item.name + "</option>";
			});

			$("#positionId").html(roles);
			$("#positionId").trigger("chosen:updated");

		});
	}
</script>
<form:form id="formProjectMember" commandName="model"
	action="project/member/save">
	<form:hidden path="id" />
	<form:hidden path="projProjectId" />
	<table class="form-table">
		<tr>
			<td class="td1">姓名：</td>
			<td class="td2"><form:hidden path="appUserName" /> <isperp:departmentUser
					displayValue="${model.memberName }" valueControlId="appUserName"
					id="memberName" name="memberName" idFieldName="name"
					afterSelected="setMemberPosition(row);"
					displayValueCssClass="required"></isperp:departmentUser>
			</td>
		</tr>
		<tr>
			<td class="td1">岗位：</td>
			<td class="td2"><form:select path="positionId"
					items="${positionList }" itemLabel="name" itemValue="id"
					cssClass="required"></form:select>
			</td>
		</tr>
		 <tr style="display:none">
			<td class="td1">月薪(元)：</td>
			<td class="td2"><form:input path="salary"
					class="required number" /></td>
		</tr>
		<tr style="display:none">
			<td class="td1">社保(元)：</td>
			<td class="td2"><form:input path="socialInsurance"
					class="required number" /></td>
		</tr>
		<tr style="display:none">
			<td class="td1">其它补助(元)：</td>
			<td class="td2"><form:input path="otherSubsidy" class="number" />
			</td>
		</tr>
		<tr>
			<td class="td1">计划进场时间：</td>
			<td class="td2"><form:input path="planInDate" type="date"
					cssClass="" />
			</td>
		</tr>
		<tr>
			<td class="td1">计划退场时间：</td>
			<td class="td2"><form:input path="planOutDate" type="date"
					cssClass="" />
			</td>
		</tr>
		<tr>
			<td class="td1">实际进场时间：</td>
			<td class="td2"><form:input path="actInDate" type="date" />
			</td>
		</tr>
		<tr>
			<td class="td1">实际退场时间：</td>
			<td class="td2"><form:input path="actOutDate" type="date" />
			</td>
		</tr>

	</table>
</form:form>

<isperp:buttonList>
	<button class="submit" onclick="isperp.submitForm(); return false;">
		<span class="icon icon-save"></span>提交
	</button>
</isperp:buttonList>